<template>
  <div class="add">
    <div class="head">
      <img class="logo" src="../../assets/images/中国连环画.png" alt="" />
      <div class="person">
        <div class="setUp">
          <div class="whitebg"></div>
          <Dropdown class="dropdownbox" @on-click="menuClick">
            <div class="bg">
              <Icon type="ios-settings" color="rgb(148,163,184)" size="20" />
            </div>
            <DropdownMenu slot="list">
              <!-- <DropdownItem name="personalCenter">设置</DropdownItem> -->
              <DropdownItem name="loginOut">注销</DropdownItem>
            </DropdownMenu>
          </Dropdown>
        </div>
        <div class="userHover">
          <div class="whitebg"></div>
          <img class="user" src="../../assets/images/icon_people.png" alt="" />
        </div>
        <p>{{ user && user.name ? user.name : "" }}</p>
      </div>
    </div>
    <div class="tableHeader">
      <p class="tableTitle">
        字典维护
        
      </p>
      <div class="d-flex align-items-center">
        <Input
          icon="ios-search"
          placeholder="请输入字典类型查询"
          v-model="searchItem.searchKey"
          @on-search="getData((page = 1))"
          search
          enter-button="搜索"
        />

        <Button class="addBtn" type="primary" @click="showImport = true"
          >+&nbsp;&nbsp;导入</Button
        >
      </div>
    </div>
    <div style="padding: 0px 2.5rem">
      <Table :columns="columns" :data="datalist" :loading="loading">
        <template slot-scope="{ row, index }" slot="action">
          <!-- <span class="btn" @click="local(index, 'add')">设置问卷</span> -->
          <!-- <span class="btn" @click="local(index, 'detail')">详情</span> -->
          <span class="btn" @click="local(index, 'edit')">编辑</span>
          <!-- <span class="btn" @click="copy(row.code)">复制</span> -->
          <span class="btn" @click="action('del', row.code)">删除</span>
        </template>
      </Table>
      <div class="text-right mt-4">
        <Page
          :total="total"
          :page-size-opts="[10, 20, 40, 50, 100]"
          show-sizer
          :current="page"
          :page-size="pageSize"
          @on-page-size-change="pageSizeChange"
          @on-change="pageChange"
        ></Page>
      </div>
    </div>

    <Modal
      title="Excel导入"
      v-model="showImport"
      width="80vm"
      footer-hide
      :mask-closable="false"
    >
      <ImportData @success="getData"></ImportData>
    </Modal>
  </div>
</template>

<script>
import add from "./index.js";
export default add;
</script>
<style lang="less" scoped>
@import "./index.less";
</style>
